package csce315.group10.androidapp;

import csce315.group10.R;
import csce315.group10.androidapp.AddContactDialog.PositionSelectedListener;
import csce315.group10.yearbook.tinymsg.C2DMClientActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;

public class AddMessageDialog extends Activity {
		
	String newTopic;
	public CustomApp appState;
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.addmessagedialog);
        appState = ((CustomApp)getApplicationContext());
        
    }
    
    
    public void okButtonHandler(View v){
    	/* gather the inputed information */
    	 EditText message = (EditText) findViewById(R.id.Get_Message_Text);
    	 String message_text = message.getText().toString();
         String author_text = appState.get_current_user().get_name();
                  
      
         /* build a new intent to return the data */
         Intent data = new Intent();
         
         data.putExtra("message_text", message_text);
         data.putExtra("author", author_text);
       
         setResult(Activity.RESULT_OK, data);
    	 finish();
    }
    
    
    
}
